package Wuzi;

import java.io.Serializable;

//棋子类
public class Chess implements Comparable<Chess>, Serializable {

    public Chess() {

    }

    public Chess(int x, int y, int player, int order) {
        super();
        this.x = x;
        this.y = y;
        this.player = player;
        this.order = order;
    }
    //棋子坐标(0,0)到（14,14）
    private int x;
    private int y;
    //标记棋子属于哪个玩家，0空，没有下棋子，1代表黑子，2代表白子
    private int player;
    //落子顺序
    private int order;

    private int offense;//进攻分值
    private int defense;//防守分值
    private int sum;//总分值
    private StringBuffer buffer=new StringBuffer();
    public int getOffense() {
        return offense;
    }

    public void setOffense(int offense) {
        this.offense = offense;
    }

    public int getDefense() {
        return defense;
    }

    public void setDefense(int defense) {
        this.defense = defense;
    }

    public int getSum() {
        return sum;
    }

    public void setSum(int sum) {
        this.sum = sum;
    }

    public int getX() {
        return x;
    }
    public void setX(int x) {
        this.x = x;
    }
    public int getY() {
        return y;
    }
    public void setY(int y) {
        this.y = y;
    }
    public int getPlayer() {
        return player;
    }
    public void setPlayer(int player) {
        this.player = player;
    }
    public int getOrder() {
        return order;
    }
    public void setOrder(int order) {
        this.order = order;
    }

    @Override
    public int compareTo(Chess o) {
        if(this.sum>o.sum) {
            return -1;
        }
        if(this.sum<o.sum) {
            return 1;
        }
        return 0;
    }

    public StringBuffer getBuffer() {
        return buffer;
    }

    public void setBuffer(StringBuffer buffer) {
        this.buffer = buffer;
    }




}
